Challenge 1_Jyoti Rani

challenge_1
Author

Jyoti Rani

Published

August 15, 2022

Code
library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ purrr   0.3.5 
✔ tibble  3.1.8      ✔ dplyr   1.0.10
✔ tidyr   1.2.1      ✔ stringr 1.5.0 
✔ readr   2.1.3      ✔ forcats 0.5.2 
Warning: package 'ggplot2' was built under R version 4.2.2
Warning: package 'tibble' was built under R version 4.2.2
Warning: package 'stringr' was built under R version 4.2.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
Code
knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)

Challenge Overview

Today’s challenge is to

  1. read in a dataset, and

  2. describe the dataset using both words and any supporting information (e.g., tables, etc)

Read in the Data

Read in one (or more) of the following data sets, using the correct R package and command.

  • railroad_2012_clean_county.csv ⭐
  • birds.csv ⭐⭐
  • FAOstat*.csv ⭐⭐
  • wild_bird_data.xlsx ⭐⭐⭐
  • StateCounty2012.xlsx ⭐⭐⭐⭐

I will be working on the “wild_bird_data” dataset.

Code
library(readxl)
wild_bird_data <- read_xlsx("/Users/jyotirani/Documents/r_subdirectory/wild_bird_data.xlsx")
Error: `path` does not exist: '/Users/jyotirani/Documents/r_subdirectory/wild_bird_data.xlsx'
Code
# View the dataset
wild_bird_data
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found

Describe the data

Using a combination of words and results of R commands, can you provide a high level description of the data? Describe as efficiently as possible where/how the data was (likely) gathered, indicate the cases and variables (both the interpretation and any details you deem useful to the reader to fully understand your chosen data).

Code
# Use dim() to get dimensions of dataset
dim(wild_bird_data)
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found

There are 147 cases in 2 columns(Reference and Taken from Figure 1 of Nee et al). Actually the second row has the real column names so we will now make second row as column names and remove the first row.

Code
#Rename the column names
colnames(wild_bird_data) <- wild_bird_data[1,]
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
#Removing the first row
wild_bird_data <- wild_bird_data[-1,]
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
#New dimensions of dataset
dim(wild_bird_data)
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
#View the dataset
wild_bird_data
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
#Summary of dataset
summary(wild_bird_data)
Error in summary(wild_bird_data): object 'wild_bird_data' not found
Code
#Converting datset to numeric
wild_bird_data$`Wet body weight [g]` <- as.numeric(wild_bird_data$`Wet body weight [g]`)
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
wild_bird_data$`Population size` <- as.numeric(wild_bird_data$`Population size`)
Error in eval(expr, envir, enclos): object 'wild_bird_data' not found
Code
#Summary of the converted dataset
summary(wild_bird_data)
Error in summary(wild_bird_data): object 'wild_bird_data' not found

Brief summary of the wild_bird dataset.